The present invention relates to a refraction mapping technique for producing an image as if looking at an object subject to refraction. The technique may be used for example, in information equipment which includes an entertainment system such as a video game device or the like.
In a video game device, when looking at the bottom of the sea through the water surface, it looks like the bottom of the sea is distorted due to refraction. Refraction mapping is known as a method of producing a realistic picture by simulating the refraction as described above.
It is required in conventional refraction mapping for a land portion protruding from the water surface and a portion under the water to implement separately a parallel projection rendering, in a vertical direction onto the water surface, thereby making the burden on a central processing unit (CPU), a graphic processing unit (GPU) and the like to be large.
Accordingly, in the light of the above-mentioned problems, it is an object of the present invention to provide a system for and a method of implementing a refraction mapping with an easy method, as well as a recording medium for the method.
A system for implementing a refraction mapping according to the present invention, includes means for perspective-projecting an object, and for producing a two-dimensional texture of the object for a texture plane; and means for determining a refracted texture address that displaces according to a refraction phenomena, for at least a portion of the texture, wherein the refracted texture address is determined, depending on a normal vector at a boundary surface of different media and a visual line vector.
It is preferable that, in the above-described system for implementing the refraction mapping according to the present invention, the refracted texture address is determined by an angle formed with the normal vector and the visual line vector or a component of the normal vector that is parallel to the texture plane.
Preferably, in the above-described system for implementing the refraction mapping according to the present invention, as a normal vector at an intersection point of the boundary surface of at least two different media and the visual line vector is defined to be n, and as the visual line unit vector is defined to be v, determining a variable k so that the sum (n+kv) of the normal vector n and the value kv of which the visual line unit vector v is multiplied by a variable k becomes parallel to the texture plane, and the texture address is displaced by an amount of a constant multiplication of (n+kv), that is L (n+kv).
Further, the texture address may be displaced with only an amount of L (nx, ny) of which two components (nx, ny) parallel to the texture plane of the normal vector n are multiplied by a constant L.
At this moment, at least two different media may represent the ones with different refractive indices such as an air, water or a glass.
It is preferable that, the above-described system for implementing the refraction mapping according to the present invention, further includes means for displacing at least a portion of a texture, based on the refracted texture address; and means for perspective-transforming on a screen, using this displaced texture.
In such system, the object has a portion projecting from the water surface, and a portion sinking under the water, and for at least a portion of the texture associated with the portion sinking under the water, a refracted texture address that is to be displaced according to a refraction phenomena can be determined.
Further, such system is preferably provided in a video game device.
In the above-described system for implementing the refraction mapping, the texture plane is defined on a plane perpendicular to the Z-axis that is in a visual line direction of a view point coordinate system, and for example, it makes possible to rendering the part (the water bottom part) under the water surface with the same procedure as the perspective projection of the land part protruding from the water surface of the topography, and as a result, a creation of a texture for use in a refraction can be made by implementing collectively the land part and the water bottom part with just one rendering.
According to this system for implementing the rendering, an amount of a displacement by a refraction phenomena will not satisfy the Snell""s law generated exactly, regarding the picture of the water bottom part under the water. However, as obtaining an amount of a displacement that is an approximate to the Snell""s law using an easy method, it makes possible to qualitatively rendering the water bottom part under the water.
Further, a method of implementing a refraction mapping according to the present invention includes the steps of: perspective-projecting an object, and producing a two-dimensional texture of the object for a texture plane; and determining a refracted texture address that displaces according to a refraction phenomena, for at least a portion of the texture, wherein the refracted texture address is determined, depending on a normal vector at a boundary surface of different media and a visual line vector.
Preferably, in the method of implementing the refraction mapping according to the present invention, the refracted texture address is determined by an angle formed with the normal vector and the visual line vector or a component of the normal vector that is parallel to the texture plane.
In the method of implementing the refraction mapping according to the present invention, as a normal vector at an intersection point of the boundary surface of at least two different media and the visual line vector is defined to be n, and as the visual line unit vector is defined to be v, determining a variable k so that the sum (n+kv) of the normal vector n and the value kv of which the visual line unit vector v is multiplied by a variable k becomes parallel to the texture plane, the refracted texture address is displaced by an amount of a constant multiplication of (n+kv), that is L (n+kv).
Moreover, the refracted texture address may be displaced with only an amount of L (nx, ny) of which two components (nx, ny) parallel to the texture plane of the normal vector n are multiplied by a constant L.